﻿@model Zor_Web.Models.Browse.V_PayTaxesBrowse
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>税收浏览</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!-- 日期选择器 -->
    <script src="~/Content/laydate/laydate.js"></script>
</head>
<body>
    <div class="layui-tab layui-tab-brief main-tab-container">
        <div class="mail-search col-sm-12 ct-padding">
            <button id="btnSearch" class="layui-btn  layui-btn-normal layui-btn-small"><span class="glyphicon glyphicon-search"></span>查询</button>
            <button id="btnExport" class="layui-btn layui-btn-springgreen  layui-btn-small"><span class="glyphicon glyphicon-share"></span> 导出</button>
        </div>
        <div class="col-sm-12  layui-tab-content">
            <div class="mail-box" style="overflow-x:scroll;white-space:nowrap;">
                <table class="layui-table" lay-skin="line">
                    <thead>
                        <tr>
                            <th hidden></th>
                            <th>街道办</th>
                            <th>社区</th>
                            <th>房屋地址</th>
                            <th>房屋面积</th>
                            <th>房屋属性</th>
                            <th>业主名称</th>
                            <th>业主电话</th>
                            <th>租金(元)</th>
                            <th>租户名称</th>
                            <th>租户电话</th>
                            <th>征收起日</th>
                            <th>征收止日</th>
                            <th>受理单号</th>
                            <th>房产税(元)</th>
                            <th>个人税(元)</th>
                            <th>税金(元)</th>
                            <th>评议后税金(元)</th>
                            <th>评议时间</th>
                            <th>评议意见</th>
                            <th>评定后税金(元)</th>
                            <th>评定时间</th>
                            <th>评定意见</th>
                            <th>审核时间</th>
                            <th>审核意见</th>
                            <th>缴税时间</th>
                            <th>实际缴税额(元)</th>
                            <th>完税证号</th>
                            <th>受理状态</th>
                        </tr>
                    </thead>
                    <tbody id="accordion">
                        @foreach (var item in Model.PageData)
                        {
                            <tr>
                                <td hidden>@item.Pt_Id</td>
                                <td>@item.StreetOffice</td>
                                <td>@item.Community</td>
                                <td>@item.Acceptance_Address</td>
                                <td>@item.Hs_Proportion</td>
                                <td>@item.Hs_attribute</td>
                                <td>@item.NatPer_Name</td>
                                <td>@item.NatPer_Phone</td>
                                <td>@(item.Lease_Rent*0.01)</td>
                                <td>@item.Tenant_Name</td>
                                <td>@item.Tenant_Phone</td>
                                <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxStartTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxEndTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td>@item.Acceptance_TicketNumber</td>
                                <td>@(item.Acceptance_PropertyTax*0.01)</td>
                                <td>@(item.Acceptance_PersonalTax*0.01)</td>
                                <td>@(item.Acceptance_Tax*0.01)</td>
                                <td>@(item.Review_Tax*0.01)</td>
                                <td>@TimeHelper.TimeStampToDateTime(item.Review_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td>@item.Review_Comment</td>
                                <td>@(item.Evaluate_Tax*0.01)</td>
                                <td>@TimeHelper.TimeStampToDateTime(item.Evaluate_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td>@item.Evaluate_Comment</td>
                                <td>@TimeHelper.TimeStampToDateTime(item.Examine_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                <td>@item.Examine_Comment</td>
                                @if (item.Pt_Date != null)
                                {
                                    <td>@TimeHelper.TimeStampToDateTime(item.Pt_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                                }
                                else
                                {
                                    <td></td>
                                } 
                                <td>@(item.Pt_ActualTax*0.01)</td>
                                <td>@item.Pt_CertificateNumber</td>
                                <td>@item.PtState</td>
                            </tr>
                        }
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-sm-9">
                        @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "", @class = "pagination" })
                    </div>
                    <div class="col-sm-3">
                        共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- 模态:查询 -->
    @using (Html.BeginForm("PayTaxesBrowse", "Browse", new RouteValueDictionary { { "Model", Model } }, FormMethod.Get))
    {
        <div id="QueryModal" style="display: none;padding: 20px;">
            <form class="layui-form">
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">街道办：</label>
                    <div class="col-sm-4">
                        <select name="StreetOffice" class="form-control" id="StreetOffice"></select>
                    </div>
                    <label class="col-sm-2 layui-form-label">社区：</label>
                    <div class="col-sm-4">
                        <select class="form-control" name="Community" id="Community"></select>                        
                    </div>
                </div>               
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">业主姓名：</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="NatPer_Name" value="@Model.NatPer_Name">
                    </div>
                    <label class="col-sm-2 layui-form-label">租户名称：</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="Tenant_Name" value="@Model.Tenant_Name">
                    </div>
                </div>             
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">受理单号：</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="Acceptance_TicketNumber" value="@Model.Acceptance_TicketNumber">
                    </div>
                    <label class="col-sm-2 layui-form-label">完税证号：</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="Pt_CertificateNumber" value="@Model.Pt_CertificateNumber">
                    </div>
                </div>
              
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">缴税起日：</label>
                    <div class="col-sm-4">
                        <input id="Acceptance_TaxStartTime" class="form-control layer-date laydate-icon" placeholder="开始日" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Acceptance_TaxStartTime" value="@Model.Acceptance_TaxStartTime">
                    </div>
                    <label class="col-sm-2 layui-form-label">缴税止日：</label>
                    <div class="col-sm-4">
                        <input id="Acceptance_TaxEndTime" class="form-control layer-date laydate-icon" placeholder="截止日" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Acceptance_TaxEndTime" value="@Model.Acceptance_TaxEndTime">
                    </div>
                </div>
               
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">评议时间：</label>
                    <div class="col-sm-4">
                        <input id="Review_Date" class="form-control layer-date laydate-icon" placeholder="评议时间" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Review_Date" value="@Model.Review_Date">
                    </div>
                    <label class="col-sm-2 layui-form-label">评定时间：</label>
                    <div class="col-sm-4">
                        <input id="Evaluate_Date" class="form-control layer-date laydate-icon" placeholder="评定时间" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Evaluate_Date" value="@Model.Evaluate_Date">
                    </div>
                </div>
               
                <div class="layui-form-item">
                    <label class="col-sm-2 layui-form-label">审核时间：</label>
                    <div class="col-sm-4">
                        <input id="Examine_Date" class="form-control layer-date laydate-icon" placeholder="审核时间" onclick="laydate({ istime: false, format: 'YYYY-MM-DD' })" name="Examine_Date" value="@Model.Examine_Date">
                    </div>
                    <label class="col-sm-2 layui-form-label">缴税状态：</label>
                    <div class="col-sm-4">
                        <select class="form-control" name="PtState">
                            <option value="" selected>全部</option>
                            <option value="未缴税">未缴税</option>
                            <option value="已缴税">已缴税</option>
                            <option value="已打印">已打印</option>
                        </select>
                    </div>
                </div>                            
            </form>
            <div class="box-footer">
                <button type="submit" id="btnQuery" class="btn btn-info pull-right">
                    <i class="fa fa-search"></i>查询
                </button>
            </div>
        </div>
    }
    <!-- 导出模态 -->
    <form action="/Browse/ExportPayTaxesBrowse" enctype="multipart/form-data" method="post" id="formDownload">
        <div id="exportHtml" style="display:none;">
            <div class="eh_wrap">
                <div class="eh_head">
                    <p style="">请选择您要导出的数据列</p>
                </div>
                <table width="100%" cellpadding="5" cellspacing="0">
                    <tr>
                        <td><input id="Community" type="checkbox" value="所属社区" name="chk_list" checked="checked" /><label>所属社区</label></td>
                        <td><input id="Bd_address" type="checkbox" value="房屋地址" name="chk_list" checked="checked" /><label>房屋地址</label></td>
                        <td><input id="Hs_Proportion" type="checkbox" value="房屋面积" name="chk_list" checked="checked" /><label>房屋面积</label></td>
                        <td><input id="Attribute" type="checkbox" value="房屋属性" name="chk_list" checked="checked" /><label>房屋属性</label></td>
                        <td><input id="NatPer_Name" type="checkbox" value="业主名称" name="chk_list" checked="checked" /><label>业主名称</label></td>
                        <td><input id="NatPer_Phone" type="checkbox" value="业主电话" name="chk_list" checked="checked" /><label>业主电话</label></td>
                    </tr>
                    <tr>

                        <td><input id="Lease_Rent" type="checkbox" value="房屋租金" name="chk_list" checked="checked" /><label>房屋租金</label></td>
                        <td><input id="Tenant_Name" type="checkbox" value="租户名称" name="chk_list" checked="checked" /><label>租户名称</label></td>
                        <td><input id="Tenant_Phone" type="checkbox" value="租户电话" name="chk_list" checked="checked" /><label>租户电话</label></td>
                        <td><input id="Acceptance_TaxStartTime" type="checkbox" value="征收起日" name="chk_list" checked="checked" /><label>征收起日</label></td>
                        <td><input id="Acceptance_TaxEndTime" type="checkbox" value="征收止日" name="chk_list" checked="checked" /><label>征收止日</label></td>
                        <td><input id="Acceptance_TicketNumber" type="checkbox" value="受理单号" name="chk_list" checked="checked" /><label>受理单号</label></td>
                    </tr>
                    <tr>
                        <td><input id="Acceptance_PropertyTax" type="checkbox" value="房产税" name="chk_list" checked="checked" /><label>房产税</label></td>
                        <td><input id="Acceptance_PersonalTax" type="checkbox" value="个人税" name="chk_list" checked="checked" /><label>个人税</label></td>
                        <td><input id="Acceptance_Tax" type="checkbox" value="税金" name="chk_list" checked="checked" /><label>税金</label></td>
                        <td><input id="Review_Tax" type="checkbox" value="评议后税金" name="chk_list" checked="checked" /><label>评议后税金</label></td>
                        <td><input id="Review_Date" type="checkbox" value="评议时间" name="chk_list" checked="checked" /><label>评议时间</label></td>
                        <td><input id="Review_Comment" type="checkbox" value="评议意见" name="chk_list" checked="checked" /><label>评议意见</label></td>
                    </tr>
                    <tr>
                        <td><input id="Evaluate_Tax" type="checkbox" value="评定后税金" name="chk_list" checked="checked" /><label>评定后税金</label></td>
                        <td><input id="Evaluate_Date" type="checkbox" value="评定时间" name="chk_list" checked="checked" /><label>评定时间</label></td>
                        <td><input id="Evaluate_Comment" type="checkbox" value="评定意见" name="chk_list" checked="checked" /><label>评定意见</label></td>
                        <td><input id="Examine_Date" type="checkbox" value="审核时间" name="chk_list" checked="checked" /><label>审核时间</label></td>
                        <td><input id="Examine_Comment" type="checkbox" value="审核意见" name="chk_list" checked="checked" /><label>审核意见</label></td>
                        <td><input id="Pt_Date" type="checkbox" value="缴税时间" name="chk_list" checked="checked" /><label>缴税时间</label></td>
                    </tr>
                    <tr>
                        <td><input id="Pt_ActualTax" type="checkbox" value="实际缴税额" name="chk_list" checked="checked" /><label>实际缴税额</label></td>
                        <td><input id="Pt_CertificateNumber" type="checkbox" value="完税证号" name="chk_list" checked="checked" /><label>完税证号</label></td>
                        <td><input id="PtState" type="checkbox" value="缴税状态" name="chk_list" checked="checked" /><label>缴税状态</label></td>
                    </tr>
                </table>
                <div class="box-footer">
                    <button type="submit" id="btnExportSure" class="btn btn-info pull-right">
                        <i class="fa fa-repeat"></i>导出
                    </button>
                    <input type="hidden" id="PayTaxesBrowseMeg" name="PayTaxesBrowseMeg" value="" />
                    <input type="hidden" id="where" name="where" value="" />
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>
    /**
    * 查询
  **/
    $(function () {
        $("#btnSearch").click(function () {
            GetCommunity();
            GetStreetOffice();
            LayerOpen('840px', '420px', '查询条件', $('#QueryModal'));//打开查询信息模态框          
        })
    })

    //获取当前社区名称
    function GetCommunity() {     
        getAjax("/Browse/SelectCommunity", "", function (data) {
            accordionJson = eval("(" + data + ")");
            $("#Community").append("<option value='' >---     选择社区    ---</option>")
            $.each(accordionJson, function (i) {
                $("#Community").append("<option value='" + accordionJson[i].Dt_Name + "' >" + accordionJson[i].Dt_Name + "</option>");
            });
        });

    }
    //获取当前街道办
    function GetStreetOffice() {
        getAjax("/Browse/SelectStreetOffice", "", function (data) {
            accordionJson = eval("(" + data + ")");
            $.each(accordionJson, function (i) {
                $("#StreetOffice").append("<option value='" + accordionJson[i].Dt_Name + "' >" + accordionJson[i].Dt_Name + "</option>");
            });
        });

    }



    /*导出*/
    $("#btnExport").click(function () {
        layer.open({
            type: 1,
            title: '导出提示',
            shade: false,
            skin: 'layui-layer-rim',
            area: ['720px', '350px'], //宽高
            content: $('#exportHtml')
        });
    });
    /*确定导出*/
    $("#btnExportSure").click(function () {
        var arr = new Array();
        $("[name='chk_list']").each(function () {
            if ($(this).is(":checked")) {
                arr.push($(this).attr("id") + "|" + $(this).val());
            }
        });
        $("#PayTaxesBrowseMeg").val(arr);
        document.getElementById('formDownload').submit();
        layer.closeAll();
    });

    /**
  * 日期选择器
  */
    laydate(
    { elem: "#Lease_StartTime", event: "focus" },

    { elem: "#Lease_EndTime", event: "focus" }
    );
</script>